I want to change the default value of an attribute so that new objects have the new default value but withough affecting the existing objects that have the default value. Is it OK to run the following script on all objects in the database (resetting every object to it's current value) before changing the default? The attribute is defined as an enumeration of strings (SITE_A, SITE_B, BOTH, NONE, etc.). I've run a few basic tests and it seems to work... Thanks, Ken.
mcnairk - Fri Nov 08 10:20:29 EST 2013 |
Re: Changing default value of an attribute Looks good. Existing objects with a default value will have that explicit value when done. However, this command inside the loop is better as it covers rich Text and doesn't waste string table space:
-Louie |
Re: Changing default value of an attribute llandale - Fri Nov 08 10:25:10 EST 2013 Looks good. Existing objects with a default value will have that explicit value when done. However, this command inside the loop is better as it covers rich Text and doesn't waste string table space:
-Louie Thanks! I was not aware of this version of the set command. I looked thru the DXL manual and it's not obvious... |
Re: Changing default value of an attribute mcnairk - Fri Nov 08 11:16:00 EST 2013 Thanks! I was not aware of this version of the set command. I looked thru the DXL manual and it's not obvious... Not in the manual... |
Re: Changing default value of an attribute Default/Inherited discussion. When an obj-attr value is null then it can APPEAR to have a Default or Inherited value; I think Inherited has precedence over Default. "Appear" means:
So if the Default value is "Hello" and you see "Hello", you don't know if that value is defaulted to "Hello" or it is set explicitely to "Hello"; but usually you do not care. If you need to know, there is a command for that:
which unfortunately forces you to get an AttrDef handle before you can query:
-Louie |